
function toggleNestedListVisibility ( node )
{
	// Loop through the child nodes of the list item, find the 
	// list node, and toggle its visibility by switching the parent
	switch ( node.className ) {
	case "col":
		node.className = "exp";   // hide
		return;
	case "exp":
		node.className = "col";   // show
		return;
	}
} 



function toolListClick ( evt )
{
	if  ( evt == null ) return;
	var src = evt.srcElement;
	if ( src == null ) return;
	switch ( src.tagName ) {
	case "IMG":
		// Opens a resizable windows with predefined size 
		// and scrollbars, and activates it. When reopened, 
		// an existing image window will be reused with current 
		// settings.
		var wnd = window.open( src.src, "imageWindow", "menubar=0,resizable=1,scrollbars=1,height=300,width=300" );
		wnd.focus( );
		break;
	case "LI":
		toggleNestedListVisibility ( src );
		break;
	}
} 

// *	
// *	Product Database Tools
// *

function pdblistInit ( )
{
	var elements = document.getElementsByTagName( "UL" ) ;
	if ( elements == null ) return;
	for ( var i = 0 ; i < elements.length ; i ++ )
	{
		if ( elements[ i ].className == "pdb-details" ) elements[ i ].style.display = "none" ;
	}
}

function pdblistClick ( evt )
{
	if ( evt == null ) evt = window.event;
	if ( evt.srcElement.className == "pdb-category" )
	{
		var detailsList;
		for ( var i = 0 ; i < evt.srcElement.childNodes.length ; i ++ )
		{
			if ( evt.srcElement.childNodes[ i ].tagName == "UL" )
			{
				if ( evt.srcElement.childNodes[ i ].style.display == "block" ) evt.srcElement.childNodes[ i ].style.display = "none" ;
				else evt.srcElement.childNodes[ i ].style.display = "block" ;
				return;
			}
		}
	}
}